package com.liang.threaddemo9;

import java.util.concurrent.ArrayBlockingQueue;

public class Cookie1 extends Thread{
    private ArrayBlockingQueue<String> list;

    public Cookie1(ArrayBlockingQueue<String> list) {
        this.list = list;
    }

    @Override
    public void run() {

        while (true) {
            try {
                list.put("汉堡包");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(getName()+"正再做汉堡包");
        }
    }
}
